package com.light.mytext.mycustomview

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.light.mytext.R
import com.light.mytext.utiles.ToastUtils
import kotlinx.android.synthetic.main.activity_my_pin_jie.*
import java.util.*

class MyPinJieActivity : AppCompatActivity() {
    private val mDatas = ArrayList<String>()
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_my_pin_jie)
        initTestDatas()
        daview.initDatasList(mDatas)


//自动滚动到最后一个item
        /* Timer timer=new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                scrollview.fullScroll(HorizontalScrollView.FOCUS_RIGHT);
            }
        },1000);*/
        daview.setOnItemViewClickListener { poi ->
            ToastUtils.show(
                this@MyPinJieActivity,
                "点击的是第" + poi + "个"
            )
        }
    }
    private fun initTestDatas() {
        for (i in 0..7) {
            mDatas.add("")
        }
    }
}